<?php
namespace app\home\controller;
use app\home\controller\Common;
use think\Db;
use app\home\model\Choice;
class Single extends Common
{
    /**
     * 根据id取出试题的详细信息
     * @access public
     * @param string $ids
     * return array
     */
    public static function getInfoById($ids){
        if($ids){
            $single = new Choice();
            $data = $single->getInfoByIds($ids);
            return $data;
        }else{
            return false;
        }
    }
    /**
     * 根据id取出试题的答案
     * @access public
     * @param string $id
     * return string
     */
    public static function getAnswerById($id){
        if($id){
            $single = new Choice();
            $data = $single->where('id', $id)
                ->field('answer')
                ->find();
            return $data;
        }else{
            return false;
        }
    }
}
